class_name ComboViewSubTypeItem_CMD_Weapon
extends ComboViewSubTypeItem

#region 属性
@export var weapon_names:Array[String]
@export var btn_scene:PackedScene
#endregion
#region 字段
#endregion
#region 信号
#endregion

#region 基类方法
func excute(combo_view:ComboView):
	super.excute(combo_view)
	for weapon_name in weapon_names:
		var weapon_info = GameWeaponSystem.get_weapon_info(weapon_name)
		if weapon_name:
			var btn:ComboViewBtn = btn_scene.instantiate() as ComboViewBtn
			btn.init_btn({display_name=weapon_name},weapon_info.weapon_scene.get_state().get_node_property_value(0,1).weapon_sprite,HORIZONTAL_ALIGNMENT_LEFT)
			btn.pressed.connect(func ():
				if GamePlayerSystem.get_player():
					GameWeaponSystem.create_weapon(weapon_name,GamePlayerSystem.get_player().global_position)
				)
			btn.toggle_mode = false
			combo_view.add_item_list_item(btn)
#endregion
#region 公共方法
#endregion
#region 私有方法
#endregion
#region 生命周期函数
#endregion
